3.106 \(\int \frac{2 a-x^2}{a^2-a x^2+x^4} \, dx\)

Optimal. Leaf size=114 \[ -\frac{\sqrt{3} \log \left (-\sqrt{3} \sqrt{a} x+a+x^2\right )}{4 \sqrt{a}}+\frac{\sqrt{3} \log \left (\sqrt{3} \sqrt{a} x+a+x^2\right )}{4 \sqrt{a}}-\frac{\tan ^{-1}\left (\sqrt{3}-\frac{2 x}{\sqrt{a}}\right )}{2 \sqrt{a}}+\frac{\tan ^{-1}\left (\frac{2 x}{\sqrt{a}}+\sqrt{3}\right )}{2 \sqrt{a}} \]

[Out]

-ArcTan[Sqrt[3] - (2*x)/Sqrt[a]]/(2*Sqrt[a]) + ArcTan[Sqrt[3] + (2*x)/Sqrt[a]]/(2*Sqrt[a]) - (Sqrt[3]*Log[a -
Sqrt[3]*Sqrt[a]*x + x^2])/(4*Sqrt[a]) + (Sqrt[3]*Log[a + Sqrt[3]*Sqrt[a]*x + x^2])/(4*Sqrt[a])

________________________________________________________________________________________

Rubi [A]  time = 0.0760081, antiderivative size = 114, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 5, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.2, Rules used = {1169, 634, 617, 204, 628} \[ -\frac{\sqrt{3} \log \left (-\sqrt{3} \sqrt{a} x+a+x^2\right )}{4 \sqrt{a}}+\frac{\sqrt{3} \log \left (\sqrt{3} \sqrt{a} x+a+x^2\right )}{4 \sqrt{a}}-\frac{\tan ^{-1}\left (\sqrt{3}-\frac{2 x}{\sqrt{a}}\right )}{2 \sqrt{a}}+\frac{\tan ^{-1}\left (\frac{2 x}{\sqrt{a}}+\sqrt{3}\right )}{2 \sqrt{a}} \]

Antiderivative was successfully verified.

[In]

Int[(2*a - x^2)/(a^2 - a*x^2 + x^4),x]

[Out]

-ArcTan[Sqrt[3] - (2*x)/Sqrt[a]]/(2*Sqrt[a]) + ArcTan[Sqrt[3] + (2*x)/Sqrt[a]]/(2*Sqrt[a]) - (Sqrt[3]*Log[a -
Sqrt[3]*Sqrt[a]*x + x^2])/(4*Sqrt[a]) + (Sqrt[3]*Log[a + Sqrt[3]*Sqrt[a]*x + x^2])/(4*Sqrt[a])

Rule 1169

Int[((d_) + (e_.)*(x_)^2)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[a/c, 2]}, With[{r =
Rt[2*q - b/c, 2]}, Dist[1/(2*c*q*r), Int[(d*r - (d - e*q)*x)/(q - r*x + x^2), x], x] + Dist[1/(2*c*q*r), Int[(
d*r + (d - e*q)*x)/(q + r*x + x^2), x], x]]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2
- b*d*e + a*e^2, 0] && NegQ[b^2 - 4*a*c]

Rule 634

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 617

Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = 1 - 4*Simplify[(a*c)/b^2]}, Dist[-2/b, Sub
st[Int[1/(q - x^2), x], x, 1 + (2*c*x)/b], x] /; RationalQ[q] && (EqQ[q^2, 1] ||  !RationalQ[b^2 - 4*a*c])] /;
 FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(d*Log[RemoveContent[a + b*x +
c*x^2, x]])/b, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rubi steps

\begin{align*} \int \frac{2 a-x^2}{a^2-a x^2+x^4} \, dx &=\frac{\int \frac{2 \sqrt{3} a^{3/2}-3 a x}{a-\sqrt{3} \sqrt{a} x+x^2} \, dx}{2 \sqrt{3} a^{3/2}}+\frac{\int \frac{2 \sqrt{3} a^{3/2}+3 a x}{a+\sqrt{3} \sqrt{a} x+x^2} \, dx}{2 \sqrt{3} a^{3/2}}\\ &=\frac{1}{4} \int \frac{1}{a-\sqrt{3} \sqrt{a} x+x^2} \, dx+\frac{1}{4} \int \frac{1}{a+\sqrt{3} \sqrt{a} x+x^2} \, dx-\frac{\sqrt{3} \int \frac{-\sqrt{3} \sqrt{a}+2 x}{a-\sqrt{3} \sqrt{a} x+x^2} \, dx}{4 \sqrt{a}}+\frac{\sqrt{3} \int \frac{\sqrt{3} \sqrt{a}+2 x}{a+\sqrt{3} \sqrt{a} x+x^2} \, dx}{4 \sqrt{a}}\\ &=-\frac{\sqrt{3} \log \left (a-\sqrt{3} \sqrt{a} x+x^2\right )}{4 \sqrt{a}}+\frac{\sqrt{3} \log \left (a+\sqrt{3} \sqrt{a} x+x^2\right )}{4 \sqrt{a}}+\frac{\operatorname{Subst}\left (\int \frac{1}{-\frac{1}{3}-x^2} \, dx,x,1-\frac{2 x}{\sqrt{3} \sqrt{a}}\right )}{2 \sqrt{3} \sqrt{a}}-\frac{\operatorname{Subst}\left (\int \frac{1}{-\frac{1}{3}-x^2} \, dx,x,1+\frac{2 x}{\sqrt{3} \sqrt{a}}\right )}{2 \sqrt{3} \sqrt{a}}\\ &=-\frac{\tan ^{-1}\left (\sqrt{3}-\frac{2 x}{\sqrt{a}}\right )}{2 \sqrt{a}}+\frac{\tan ^{-1}\left (\sqrt{3}+\frac{2 x}{\sqrt{a}}\right )}{2 \sqrt{a}}-\frac{\sqrt{3} \log \left (a-\sqrt{3} \sqrt{a} x+x^2\right )}{4 \sqrt{a}}+\frac{\sqrt{3} \log \left (a+\sqrt{3} \sqrt{a} x+x^2\right )}{4 \sqrt{a}}\\ \end{align*}

Mathematica [C]  time = 0.175998, size = 115, normalized size = 1.01 \[ \frac{\sqrt [4]{-1} \left (\sqrt{\sqrt{3}-i} \left (\sqrt{3}-3 i\right ) \tanh ^{-1}\left (\frac{(1+i) x}{\sqrt{\sqrt{3}+i} \sqrt{a}}\right )-\sqrt{\sqrt{3}+i} \left (\sqrt{3}+3 i\right ) \tan ^{-1}\left (\frac{(1+i) x}{\sqrt{\sqrt{3}-i} \sqrt{a}}\right )\right )}{2 \sqrt{6} \sqrt{a}} \]

Antiderivative was successfully verified.

[In]

Integrate[(2*a - x^2)/(a^2 - a*x^2 + x^4),x]

[Out]

((-1)^(1/4)*(-(Sqrt[I + Sqrt[3]]*(3*I + Sqrt[3])*ArcTan[((1 + I)*x)/(Sqrt[-I + Sqrt[3]]*Sqrt[a])]) + Sqrt[-I +
 Sqrt[3]]*(-3*I + Sqrt[3])*ArcTanh[((1 + I)*x)/(Sqrt[I + Sqrt[3]]*Sqrt[a])]))/(2*Sqrt[6]*Sqrt[a])

________________________________________________________________________________________

Maple [A]  time = 0.067, size = 92, normalized size = 0.8 \begin{align*}{\frac{\sqrt{3}}{4}\ln \left ( a+{x}^{2}+x\sqrt{3}\sqrt{a} \right ){\frac{1}{\sqrt{a}}}}+{\frac{1}{2}\arctan \left ({ \left ( 2\,x+\sqrt{3}\sqrt{a} \right ){\frac{1}{\sqrt{a}}}} \right ){\frac{1}{\sqrt{a}}}}-{\frac{\sqrt{3}}{4}\ln \left ( x\sqrt{3}\sqrt{a}-{x}^{2}-a \right ){\frac{1}{\sqrt{a}}}}-{\frac{1}{2}\arctan \left ({ \left ( \sqrt{3}\sqrt{a}-2\,x \right ){\frac{1}{\sqrt{a}}}} \right ){\frac{1}{\sqrt{a}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-x^2+2*a)/(x^4-a*x^2+a^2),x)

[Out]

1/4*ln(a+x^2+x*3^(1/2)*a^(1/2))*3^(1/2)/a^(1/2)+1/2/a^(1/2)*arctan((2*x+3^(1/2)*a^(1/2))/a^(1/2))-1/4/a^(1/2)*
3^(1/2)*ln(x*3^(1/2)*a^(1/2)-x^2-a)-1/2/a^(1/2)*arctan((3^(1/2)*a^(1/2)-2*x)/a^(1/2))

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} -\int \frac{x^{2} - 2 \, a}{x^{4} - a x^{2} + a^{2}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-x^2+2*a)/(x^4-a*x^2+a^2),x, algorithm="maxima")

[Out]

-integrate((x^2 - 2*a)/(x^4 - a*x^2 + a^2), x)

________________________________________________________________________________________

Fricas [B]  time = 1.81704, size = 1616, normalized size = 14.18 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-x^2+2*a)/(x^4-a*x^2+a^2),x, algorithm="fricas")

[Out]

1/24*(sqrt(3)*a*sqrt(a^(-2)) + 2*sqrt(3))*sqrt(-4*a*sqrt(a^(-2)) + 8)*(a^(-2))^(1/4)*log(6*a^2*sqrt(a^(-2)) +
6*x^2 + (sqrt(3)*a^2*sqrt(a^(-2))*x + 2*sqrt(3)*a*x)*sqrt(-4*a*sqrt(a^(-2)) + 8)*(a^(-2))^(1/4)) - 1/24*(sqrt(
3)*a*sqrt(a^(-2)) + 2*sqrt(3))*sqrt(-4*a*sqrt(a^(-2)) + 8)*(a^(-2))^(1/4)*log(6*a^2*sqrt(a^(-2)) + 6*x^2 - (sq
rt(3)*a^2*sqrt(a^(-2))*x + 2*sqrt(3)*a*x)*sqrt(-4*a*sqrt(a^(-2)) + 8)*(a^(-2))^(1/4)) - 1/2*sqrt(-4*a*sqrt(a^(
-2)) + 8)*(a^(-2))^(1/4)*arctan(1/18*(sqrt(6)*a^2*sqrt(a^(-2)) + 2*sqrt(6)*a)*sqrt(6*a^2*sqrt(a^(-2)) + 6*x^2
+ (sqrt(3)*a^2*sqrt(a^(-2))*x + 2*sqrt(3)*a*x)*sqrt(-4*a*sqrt(a^(-2)) + 8)*(a^(-2))^(1/4))*sqrt(-4*a*sqrt(a^(-
2)) + 8)*(a^(-2))^(3/4) - 1/3*(a^2*sqrt(a^(-2))*x + 2*a*x)*sqrt(-4*a*sqrt(a^(-2)) + 8)*(a^(-2))^(3/4) - 1/3*sq
rt(3)*a*sqrt(a^(-2)) - 2/3*sqrt(3)) - 1/2*sqrt(-4*a*sqrt(a^(-2)) + 8)*(a^(-2))^(1/4)*arctan(1/18*(sqrt(6)*a^2*
sqrt(a^(-2)) + 2*sqrt(6)*a)*sqrt(6*a^2*sqrt(a^(-2)) + 6*x^2 - (sqrt(3)*a^2*sqrt(a^(-2))*x + 2*sqrt(3)*a*x)*sqr
t(-4*a*sqrt(a^(-2)) + 8)*(a^(-2))^(1/4))*sqrt(-4*a*sqrt(a^(-2)) + 8)*(a^(-2))^(3/4) - 1/3*(a^2*sqrt(a^(-2))*x
+ 2*a*x)*sqrt(-4*a*sqrt(a^(-2)) + 8)*(a^(-2))^(3/4) + 1/3*sqrt(3)*a*sqrt(a^(-2)) + 2/3*sqrt(3))

________________________________________________________________________________________

Sympy [A]  time = 0.369861, size = 27, normalized size = 0.24 \begin{align*} - \operatorname{RootSum}{\left (16 t^{4} a^{2} - 4 t^{2} a + 1, \left ( t \mapsto t \log{\left (- 2 t a + x \right )} \right )\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-x**2+2*a)/(x**4-a*x**2+a**2),x)

[Out]

-RootSum(16*_t**4*a**2 - 4*_t**2*a + 1, Lambda(_t, _t*log(-2*_t*a + x)))

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int -\frac{x^{2} - 2 \, a}{x^{4} - a x^{2} + a^{2}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-x^2+2*a)/(x^4-a*x^2+a^2),x, algorithm="giac")

[Out]

integrate(-(x^2 - 2*a)/(x^4 - a*x^2 + a^2), x)